# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=xgalaga
pkgver=2.1.1.0
pkgrel=1
pkgdesc="Clone of the classic game Galaga for the X Window System"
url="http://rumsey.org/xgal.html"
arch="all"
license="GPL-2.0-only"
makedepends="linux-headers libx11-dev libxmu-dev libxpm-dev man-db"
subpackages="$pkgname-doc"
options="!check" # No testsuite
source="https://sourceforge.net/projects/aat-linux-repository/files/sources/alpine/xgalaga/xgalaga-$pkgver.tar.gz
	xgalaga.desktop
	xgalaga-hyperspace.desktop
	xgalaga-icon.xpm
	"

prepare() {
	default_prepare
	update_config_sub
	update_config_guess
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr/share/games/xgalaga \
		--mandir=/usr/share/man \
		--exec_prefix=/usr/bin
	make
}

package() {
	make install \
		DESTDIR="$pkgdir" \
		mandir=/usr/share/man \
		prefix=/usr/share/games/xgalaga \
		exec_prefix=/usr/bin
	install -Dm644 "$srcdir"/xgalaga.desktop \
	"$pkgdir"/usr/share/applications/xgalaga.desktop
	install -Dm644 "$srcdir"/xgalaga-hyperspace.desktop \
	"$pkgdir"/usr/share/applications/xgalaga-hyperspace.desktop
	install -Dm664 "$srcdir"/xgalaga-icon.xpm \
	"$pkgdir"/usr/share/pixmaps/xgalaga-icon.xpm
}

sha512sums="9b9defc3e306c2fab9549dec6b56e72d3b41e0c0560b92cb08425bd64ea4a6e1be84dab3162a8c8afc06d619ae6c2c0df0a5a40aa42f7aea6ecce60b3d49122f  xgalaga-2.1.1.0.tar.gz
03abc0b497fd85f71b5b65b841c3d4443007be98bb8195ac1a27e75e0e3ad767247739629fb8e979cef1d37f554e4cf522f8cc3892f2f021e9cbc53833f4d563  xgalaga.desktop
04fde2562c10f40809ca30364ae3013a769bc6d635028707c3b9fd6076e47a7d3ab9d2f5acf4477543d403f79fd821f4d8f12749e784335cec737784bd1c6268  xgalaga-hyperspace.desktop
dea30501caaff5001cb012cdad8f58f1854ec5c45f2a68266f5a25c63120defb91ea77a98a7fa21a145c32af3a693a0c604fc3cb838d1f06da43231acbc67b4a  xgalaga-icon.xpm"
